template<class T>
struct Spliter {
  void add(T v) {
    val_.emplace_back(v);
  }

  int get(T v) {
    return lower_bound(val_.begin(), val_.end(), v) - val_.begin() + 1;
  }

  void build() {
    sort(val_.begin(), val_.end());
    val_.erase(unique(val_.begin(), val_.end()), val_.end());
  }

  int size() {
    return val_.size();
  }

  vector<T> get_all() {
    return val_;
  }
  vector<T> val_;
};